//
//  Data.m
//  xKey Interface
//
//  Created by Guillaume SOURDRILLE on 19/02/12.
//  Copyright (c) 2012 Edenyorke. All rights reserved.
//

#import "Data.h"

@implementation Data

static Data *sharedInstance = nil;

// Get the shared instance and create it if necessary.
+ (Data *)sharedInstance {
    if (sharedInstance == nil) {
        sharedInstance = [[super allocWithZone:NULL] init];
    }
    
    return sharedInstance;
}

// We can still have a regular init method, that will get called the first time the Singleton is used.
- (id)init
{
    self = [super init];
    
    if (self) {
       
    }
    
    return self;
}

// Your dealloc method will never be called, as the singleton survives for the duration of your app.
// However, I like to include it so I know what memory I'm using (and incase, one day, I convert away from Singleton).
-(void)dealloc
{
   
}

// We don't want to allocate a new instance, so return the current one.
+ (id)allocWithZone:(NSZone*)zone {
    return [self sharedInstance];
}

// Equally, we don't want to generate multiple copies of the singleton.
- (id)copyWithZone:(NSZone *)zone {
    return self;
}

- (void) setDonnees:(NSMutableArray*) data{
    donnees = data;
    
}
- (NSMutableArray*) getDonnees{
    return donnees;
}





@end
